package jasonllinux.app.test;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;

public class Activity02 extends Activity {
	//控件

	private TextView myTextView;
	
	private EditText factor1;
	private EditText factor2;
	private TextView symbol;
	private Button calButton;
	
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		// TODO Auto-generated method stub
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity02);
		myTextView = (TextView)findViewById(R.id.mytext2);
		myTextView.setText("计算");
		//start
		factor1 = (EditText)findViewById(R.id.factor1);
		factor2 = (EditText)findViewById(R.id.factor2);
		
		symbol = (TextView)findViewById(R.id.symbol);
		symbol.setText(R.string.symbol);
		
		calButton = (Button)findViewById(R.id.cal);
		calButton.setText(R.string.cal);
		calButton.setOnClickListener(new MyButtonListener());
	}
	
	class MyButtonListener implements OnClickListener {

		@Override
		public void onClick(View v) {
			String factor_string1 = factor1.getText().toString();
			String factor_string2 = factor2.getText().toString();
			
			Intent intent = new Intent();
			intent.putExtra("factor_1", factor_string1);
			intent.putExtra("factor_2", factor_string2);
			
			intent.setClass(Activity02.this, Activity03.class);
			Activity02.this.startActivity(intent);
		}
		
	}
	
	

}
